package org.quipu.domain;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;

@Entity
@Table(name = "DEBT_DETAILS")
@NamedQueries({
    @NamedQuery(name = "Debt.findAll", query = "SELECT d FROM Debt d")
})
public class Debt extends UniqueEntity implements Serializable {

    @OneToMany(mappedBy = "debt")
    private Collection<Account> accounts;

    @Column(name = "PERCENT", nullable = false)
    private Double percent;

    @Column(name = "END_DATE", nullable = true)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date endDate;

    @Column(name = "PAY_DAY", nullable = true)
    private Integer payDay;

    @Column(name = "MONTHLY_SUM", nullable = true)
    private Double monthlySum;

    @Column(name = "FORMULA", nullable = true)
    private String formula;

    public Collection<Account> getAccounts() {
        return accounts;
    }

    public void setAccounts(Collection<Account> accounts) {
        this.accounts = accounts;
    }

    public Double getPercent() {
        return percent;
    }

    public void setPercent(Double percent) {
        this.percent = percent;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getPayDay() {
        return payDay;
    }

    public void setPayDay(Integer payDay) {
        this.payDay = payDay;
    }

    public Double getMonthlySum() {
        return monthlySum;
    }

    public void setMonthlySum(Double monthlySum) {
        this.monthlySum = monthlySum;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }
}
